package file;

import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author guoqf
 * @date 2021/7/15 15:07
 */
public class MapTest {
    public static void main(String[] args) {
        testMapRemove();
    }

    private static void testMapRemove() {
        Map<Integer, List<Integer>> map = new HashMap<>();

        map.put(1, Arrays.asList(11, 12, 13));
        map.put(2, Arrays.asList(21, 22, 23));
        map.put(3, Arrays.asList(31, 32, 33));
        map.put(4, Arrays.asList(41, 42, 43));


        map.entrySet().removeIf(entry->{
            for (Integer integer : entry.getValue()) {

                if (integer % 4 == 0) {
                   return true;
                }
            }
            return false;
        });


        System.out.println(map);
    }
}
